package common;

import java.io.Serializable;

/**
 * @author Michele Bortolato
 * Represent an Item that can be ordered by a client
 */
public class Item implements Serializable {

	private static final long serialVersionUID = 1L;
	
	/**
	 * Name of the Item
	 */
	private String name;
	/**
	 * A brief description of the Item 
	 */
	private String description;
	/**
	 * Category of the Item
	 */
	private String category;
	/**
	 * An unuque identifier of the Item
	 */
	private short ID;
	/**
	 * The Availability of the Item in the restaurant, a value of -1 
	 * indicate an unbouded availability
	 */
	private short avail;
	
	/**
	 * The Prize of the Item
	 */
	private double price;
	
	
	
	/**Constructor
	 * @param n Name
	 * @param d Description
	 * @param c Category
	 * @param id ID
	 * @param pz Price
	 * @param a Availability
	 */
	public Item(String n, String d,String c, short id, double pz, short a){
		setName(n); 
		setDescription(d);
		setCategory(c);
		setID(id);
		setPrice(pz);
		setAvail(a);
	}

	public void setAvail(int avail) {
		this.avail = (short)avail;
	}

	public short getAvail() {
		//System.out.println("A:"+avail);
		return avail;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCategory() {
		return category;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public void setID(short iD) {
		ID = iD;
	}

	public short getID() {
		return ID;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public double getPrice() {
		return price;
	}
}
